package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ShopOrderMapper;
import com.ruoyi.system.domain.ShopOrder;
import com.ruoyi.system.service.IShopOrderService;

/**
 * 订单主Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-10-20
 */
@Service
public class ShopOrderServiceImpl implements IShopOrderService 
{
    @Autowired
    private ShopOrderMapper shopOrderMapper;

    /**
     * 查询订单主
     * 
     * @param orderId 订单主主键
     * @return 订单主
     */
    @Override
    public ShopOrder selectShopOrderByOrderId(String orderId)
    {
        return shopOrderMapper.selectShopOrderByOrderId(orderId);
    }

    /**
     * 查询订单主列表
     * 
     * @param shopOrder 订单主
     * @return 订单主
     */
    @Override
    public List<ShopOrder> selectShopOrderList(ShopOrder shopOrder)
    {
        return shopOrderMapper.selectShopOrderList(shopOrder);
    }

    /**
     * 新增订单主
     * 
     * @param shopOrder 订单主
     * @return 结果
     */
    @Override
    public int insertShopOrder(ShopOrder shopOrder)
    {
        shopOrder.setCreateTime(DateUtils.getNowDate());
        return shopOrderMapper.insertShopOrder(shopOrder);
    }

    /**
     * 修改订单主
     * 
     * @param shopOrder 订单主
     * @return 结果
     */
    @Override
    public int updateShopOrder(ShopOrder shopOrder)
    {
        return shopOrderMapper.updateShopOrder(shopOrder);
    }

    /**
     * 批量删除订单主
     * 
     * @param orderIds 需要删除的订单主主键
     * @return 结果
     */
    @Override
    public int deleteShopOrderByOrderIds(String[] orderIds)
    {
        return shopOrderMapper.deleteShopOrderByOrderIds(orderIds);
    }

    /**
     * 删除订单主信息
     * 
     * @param orderId 订单主主键
     * @return 结果
     */
    @Override
    public int deleteShopOrderByOrderId(String orderId)
    {
        return shopOrderMapper.deleteShopOrderByOrderId(orderId);
    }
}
